'''
1. 试客联盟rsa加密
'''

rsa_url = "http://login.shikee.com/getkey?v=7683a7799fce5866aebacb2b7a2e11f0"
heards = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36"
}
import requests
import re

rsa_n = re.findall(r'var rsa_n = "(.*?)"', requests.get(url=rsa_url, headers=heards).text)[0]

print(rsa_n)
import execjs

node = execjs.get()

ctx = node.compile(open('./文件/试客联盟.js', encoding='utf-8').read())

funcName = 'getPwd("{0}", "{1}")'.format("123456", rsa_n)

pwd = ctx.eval(funcName)
print(pwd)